import React from 'react'

import {WeaTools} from 'ecCom';
let Base64 = WeaTools.Base64;


export default class ContainerViewProxy extends React.Component{

    render(){
        const {ContainerView} = this.props
        const {data,tabId} = this.props.state
        const {items} = data

        //有more页面地址元素
        let moreUrl = "/spa/document/static/index.html#/main/document/more?fromwhere=jsonFilter&outDoc=1&jsonstr="
        let json = {"newsCatalogIds":[]}
        if(items.length > 0 && items.find((element)=>(element.id == tabId))){
            json.newsCatalogIds = items.find((element)=>(element.id == tabId)).setting.doc.split(',')
        }
        moreUrl += Base64.encode(JSON.stringify(json))

        // //没有more页面地址元素，需要在setting 中设配置项
        // let moreUrl = ""
        // if(items.length > 0){
        //     moreUrl = items[tabId].setting.moreUrl
        // }
        return (
            <ContainerView ecId={`${this && this.props && this.props.ecId || ''}_ContainerView@7qjy1y`}  ref='ContainerView' {...this.props} moreUrl={moreUrl}></ContainerView>
        )
    }
}